<template>
	<view class="content">
		<text v-if="touchs.length==0" class="tips">
			还没有关注的人哦~~
		</text>
		<view class="touch" v-for="(item,index) in touchs" :key="index" @click="go_info(index)">
			<image :src="getRealPath(item.imgUrl)" class="icon" mode=""></image>
			<text>{{item.nickName}}</text>
			<image src="../../static/images/right.png" class="right" mode=""></image>
		</view>
	</view>
</template>

<script>
	import utils from "../../static/js/utils.js"
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				touchs: []
			}
		},
		computed: {
			...mapState(['user'])
		},
		methods: {
			go_info(index) {
				let userId = this.touchs[index].id;
				uni.navigateTo({
					url: '../usercenter/userinfo?userId=' + userId
				});
			},
			getRealPath(path) {
				return utils.baseImgUrl + path;
			}
		},
		onLoad() {
			let that = this;
			utils.post("user/getstar", {
				userId: this.user.id
			}, function(data) {
				that.touchs = data;
			});
		}
	}
</script>

<style>
	page {
		background-color: #f6f6f6;
	}

	.content {
		display: flex;
		flex-direction: column;
		width: 100%;

	}

	.tips {
		font-size: 33upx;
		width: 100%;
		margin-top: 190upx;
		color: #666;
		height: 60upx;
		text-align: center;
	}

	.touch {
		width: 100%;
		height: 150upx;
		display: flex;
		flex-direction: row;
		align-items: center;
		background-color: #ffffff;
		margin-bottom: 2upx;
	}

	.touch .icon {
		margin-left: 30upx;
		width: 120upx;
		height: 120upx;
		border-radius: 120upx;
	}

	.touch text {
		font-size: 34upx;
		margin-left: 30upx;
		flex: 1;
	}

	.right {
		width: 48upx;
		height: 48upx;
		margin-right: 30upx;
	}
</style>
